package com.dog.basics.rabbitmq.callback;

import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @program: d-basic-composition
 *
 * @description: 生产者 - 生产者失败编写
 *
 * @author: Guo
 *
 * @create: 2019-08-10 16:49
 **/
@Log4j2
public class RabbitReturnCallback implements RabbitTemplate.ReturnCallback {

	@Override
	public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
		log.info("消息丢失:exchange({}),route({}),replyCode({}),replyText({}),message:{}", exchange, routingKey, replyCode, replyText, message);
	}
}
